﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Nature.Toolkit
{
    public partial struct TPYVector
    {
        public void SetY(double value)
        {
            for (int isp = 0; isp < Nsp; ++isp) { m_vector[isp] = value; }
        }

        public void CopyFrom(IdealGasMixture mixture)
        {
            int nsp = mixture.Nsp;
            if (m_vector == null) { m_vector = new double[mixture.Nsp + 2]; }
            var y = mixture.SpeciesMassFractions.Data;
            for (int isp = 0; isp < nsp; ++isp) { m_vector[isp] = y[isp]; }
            T = mixture.Temperature;
            P = mixture.Pressure;
        }

        public void CopyTo(IdealGasMixture mixture)
        {
            mixture.UpdateTPY(T, P, Y);
        }

    }
}
